package com.example.test1.controller;

import com.example.test1.annoation.UserLoginToken;
import com.example.test1.dto.GoodsF01Rp;
import com.example.test1.entity.Goods;
import com.example.test1.mapper.GoodsMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/goods")
public class GoodsController {

    static Logger logger = LoggerFactory.getLogger(GoodsController.class);


    @Autowired
    GoodsMapper goodsMapper;

    @GetMapping("all")
//    @UserLoginToken
    public ResponseEntity<GoodsF01Rp> GoodsF01(){
        GoodsF01Rp goodsF01Rp=new GoodsF01Rp();
        logger.info("现在时刻:{}",new Date());
        goodsF01Rp.setGoodsList(goodsMapper.GoodsF01SQL());
        return new ResponseEntity<GoodsF01Rp>(goodsF01Rp, HttpStatus.OK);
    }
}
